<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<? include '../console/device_console.php'; $mysql=new Mysql(); ?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="../css/iframe01.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body{
	padding-left:20px;
	font:15px '微软雅黑';
	color:#666;
}
table td{ border:0; height:40px;}
label{
	color:#666;
}

.file-box{ position:relative;width:340px} 
.txt{ } 
.btn{ background-color:#FFF; border:1px solid #CDCDCD; width:65px; height:25px; font:13px '微软雅黑';} 
.file{ position:absolute; top:0; right:40px; height:24px; filter:alpha(opacity:0);opacity: 0;width:260px } 

</style>
</head>

<?php
if(isset($_POST['submit'])){
	$type=$_POST['type'];
	$number=$_POST['number'];
	$product=$_POST['product'];
	$info=nl2br($_POST['info']);
	$mac=$_POST['mac'];
	$version=$_POST['version'];
	$os=$_POST['os'];
	$other=$_POST['other'];
	
	if($type==NULL){
		alert("信息不全");
		open("./device_iframe_add.php","_self");
	}
	
	$status=$mysql->addDevice($type,$number,$product,$info,$mac,$os,$version,$other);
	
	if($status==1){
		alert($info);
	}else{
		alert("添加失败!");
	}
}
?>

<body>
<table width="80%" align="left" border="0" cellpadding="0" cellspacing="0" height="300">
<form action="./device_iframe_add.php" method="post" enctype="multipart/form-data">
<tr><td width="100px"><label>类型:</label></td><td>
<select name="type" class="select">
<option value="手机">手机</option>
<option value="IPAD">IPAD</option>
<option value="PC主机">PC主机</option>
<option value="服务器">服务器</option>
<option value="显示器">显示器</option>
<option value="路由器">路由器</option>
<option value="网络设备">网络设备</option>
<option value="其他">其他</option>
</select></td></tr>
<tr><td><label>型号:</label></td><td><input type="text" name="number" class="text02" /></td></tr>
<tr><td><label>厂商:</label></td><td><input type="text" name="product" class="text02" /></td></tr>
<tr><td><label>配置:</label></td><td><textarea name="info" class="textarea"></textarea></td></tr>
<tr><td><label>MAC地址:</label></td><td><input type="text" name="mac" class="text02" /></td></tr>
<tr><td><label>OS:</label></td><td><input type="text" name="os" class="text02" /></td></tr>
<tr><td><label>版本号:</label></td><td><input type="text" name="version" class="text02" /></td></tr>
<tr><td><label>其他:</label></td><td><input type="text" name="other" class="text02" /></td></tr>
<tr><td colspan="2"><input type="submit" name="submit" value="确定" class="button01" /></td></tr>
</form>
</table>
</body>
</html>